/*
 * 版权所有 (C) 2015 知启蒙(ZHIQIM) 保留所有权利。[遇见知启蒙，邂逅框架梦]
 * 
 * https://zhiqim.org/project/zhiqim_framework/zhiqim_orm.htm
 *
 * Zhiqim Orm is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */
package org.zhiqim.orm.executor;

import java.sql.Connection;
import java.util.List;

import org.zhiqim.kernel.logging.Log;
import org.zhiqim.kernel.logging.LogFactory;
import org.zhiqim.kernel.model.maps.MapSS;
import org.zhiqim.orm.ORMConstants;
import org.zhiqim.orm.ORMException;
import org.zhiqim.orm.ORMServer;

/**
 * 批量处理器接口，传递OMR服务，连接，update，参数列表和可替换表等
 * 
 * @version v1.0.0 @author zouzhigang 2014-3-21 新建与整理
 */
public interface BatchExecutor extends ORMConstants
{
    public final Log log = LogFactory.getLog(QueryExecutor.class);
    public final Log uSqlLog = LogFactory.getLog("update.sql.log");
    public final Log qSqlLog = LogFactory.getLog("query.sql.log");

    /**
     * 执行executeBatch处理
     * 
     * @param server        ORM服务
     * @param conn          数据库连接
     * @param sql           ZSQL语句
     * @param paramList     参数列表
     * @param replaceMap    可替换表
     * @return              返回int，处理条数
     * @throws ORMException 映射异常
     */
    public int[] execute(ORMServer server, Connection conn, String sql, List<?> paramList, MapSS replaceMap) throws ORMException;
}
